import http from "@/utils/http";

// 获取收获地址列表
export const getMemberAddress = () => {
    return http({
        url: '/member/address'
    })
}

// 新增收货地址
// /member/address
export const postMemberAddress = (data) => {
    return http({
        url: '/member/address',
        method: 'post',
        data
    })
}

/** 
* @param 根据id删除收货地址
*
*/
export const deleteMemberAddress = (id) => {
    return http({
        url: `/member/address/${id}`,
        method: 'delete',

    })
}

/** 
* @param 根据id获取收货地址
*
*/
export const getDetailMemberAddress = (id) => {
    return http({
        url: `/member/address/${id}`
    })
}

/**
 * 
 * @param {string} id  传入需要修改地址的id
 * @param {object} data 传入修改后的值 
 */
export const putDetailMemberAddress = (id, data) => {
    return http({
        url: `/member/address/${id}`,
        method: 'put',
        data
    })
}